<?php
class Application_Model_User{
	protected $_etudiant_id;
	protected $_name;
	protected $_firstname;
	protected $_email;
	protected $_matricule;
	protected $_section;
	protected $_annee;
	protected $_login;
	protected $_password;

	public function __construct(array $options = null){
		if(is_array($options)){
			$this->setOptions($options);
		}
	}
	public function __set($name, $value){
		$method = 'set' . $name;
		if(('mapper' == $name ) || !method_exists($this, $method)){
			throw new Exception('Invalid guestbook property');
		}
		$this->$method($value);
	}
	public function __get($name){
		$method = 'get' . $name;
		if (('mapper' == $name) || !method_exists($this, $method)) {
			throw new Exception('Invalid guestbook property');
		}
		return $this->$method();
	}
	public function setOptions(array $options){
		$methods = get_class_methods($this);
		foreach ($options as $key => $value) {
			$method = 'set' . ucfirst($key);
			if(in_array($method, $methods)){
				$this->$method($value);
			}
		}
		return $this;
	}
	public function setEtudiant_id($id){
		$this->_etudiant_id = (int) $id;
		return $this;
	}
	public function getEtudiant_id(){
		return $this->_etudiant_id;
	}
	public function setName($name){
		$this->_name = $name;
		return $this;
	}
	public function getName(){
		return $this->_name;
	}
	public function setFirstname($fn){
		$this->_firstname = $fn;
		return $this;
	}
	public function getFirstname(){
		return $this->_firstname;
	}
	public function setEmail($email){
		$this->_email = $email;
		return $this;
	}
	public function getEmail(){
		return $this->_email;
	}
	public function setMatricule($mat){
		$this->_matricule = $mat;
		return $this;
	}
	public function getMatricule(){
		return $this->_matricule;
	}
	public function setSection($sect){
		$this->_section = (int) $sect;
		return $this;
	}
	public function getSection(){
		return $this->_section;
	}
	public function setAnnee($an){
		$this->_annee = (int) $an;
		return $this;
	}
	public function getAnnee(){
		return $this->_annee;
	}
	public function setLogin($log){
		$this->_login = $log;
		return $this;
	}
	public function getLogin(){
		return $this->_login;
	}
	public function setPassword($pass){
		$this->_password = $pass;
		return $this;
	}
	public function getPassword(){
		return $this->_password;
	}
}